package org.example.serializer;

import java.io.IOException;


public interface Serializer {
    /**
     * 序列化
     * @param object
     * @return
     * @param <T>
     * @throws IOException
     */
    <T> byte[] serialize(T object)throws IOException;

    /**
     * 反序列化
     * @param bytes
     * @return
     * @param <T>
     * @throws
     */
    <T> T deserialize(byte[] bytes, Class<T> type)throws IOException;
}
